package com.hospital.demo.controller.gaoyuran;

import com.hospital.demo.model.gaoyuran.Experiment;
import com.hospital.demo.service.gaoyuran.ExperimentSer;
import com.hospital.demo.util.ResultUtils;
import com.hospital.demo.util.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/experiment")
@Api(tags={"G_临床实验接口"})
public class ExperimentCon {

    @Autowired
    private ExperimentSer experimentSer;


    @ApiOperation(value = "获取全部临床实验信息", notes = "")
    @GetMapping("/findAllExperiment")
    private ResultVO findAllExperiment() {
        return ResultUtils.success(experimentSer.findAllExperiment());
    }

    @ApiOperation(value = "添加临床实验信息", notes = "")
    @PostMapping("/AddExperiment")
    private ResultVO AddExperiment(Experiment experiment, String token) {
        return ResultUtils.success(experimentSer.AddExperiment(experiment));
    }

    @ApiOperation(value = "更新临床实验信息", notes = "")
    @PostMapping("/upDateExperiment")
    private ResultVO upDateExperiment(Experiment experiment, String token) {
        return ResultUtils.success(experimentSer.upDateExperiment(experiment));
    }
}
